import http from "./request.ts"
// /home/advertise/list分页查询广告
export const getAdvertiseList = (params: IAdvertiseListParams): RES<IAdvertiseListModel> => http.get("/home/advertise/list", { params })

// /home/advertise/update/status/{id} 修改上下线状态
export const advertiseUpdateStatus = (params: { id: number, status: number }): RES<any> => http.post(`/home/advertise/update/status/${params.id}?status=${params.status}`)


// /home/advertise/delete 删除广告

// 添加参数到 formData
// export const homeAdvertiseDelete = (ids: number): RES<IAdvertiseListModel> => http.post(`/home/advertise/delete`, new FormData().append('ids', String(ids)))

// export const homeAdvertiseDelete = (ids: number[]): RES<IStatusRes> => {
//     // 创建一个新的 FormData 对象
//     const formData = new FormData();
//     // 添加参数到 formData
//     formData.append('ids', String(ids));
//     return http.post(`/home/advertise/delete`, formData);
// };
export const homeAdvertiseDelete = (ids: number[]): RES<IStatusRes> => http.post(`/home/advertise/delete?ids=${ids}`)